package com.xuanwei.admin;


import com.github.tobato.fastdfs.FdfsClientConfig;
import com.xuanwei.core.util.IdWorker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.*;
import org.springframework.jmx.support.RegistrationPolicy;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScans({
        @ComponentScan("com.xuanwei.core"),
        @ComponentScan("com.xuanwei.admin")
})
@MapperScan("com.xuanwei.dao.mapper")
@EnableCaching
@Import(FdfsClientConfig.class)
// 解决jmx重复注册bean的问题
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
@EnableAsync
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

    @Bean
    public IdWorker idWorker(){
        return new IdWorker(1,1);
    }


}

